// 方法 1（推荐，TS 中标准的枚举）：
// 定义枚举
enum RegionLevel {
  PROVINCE = "province",
  CITY = "city",
  AREA = "area",
  STREET = "street"
}

// 创建标签映射
const RegionLevelLabels: Record<RegionLevel, string> = {
  [RegionLevel.PROVINCE]: "省",
  [RegionLevel.CITY]: "市",
  [RegionLevel.AREA]: "区",
  [RegionLevel.STREET]: "街道"
};

// 辅助函数获取标签
function getRegionLevelLabel(level: RegionLevel): string {
  return RegionLevelLabels[level];
}

// 使用示例
console.log(RegionLevel.PROVINCE); // "province"
console.log(getRegionLevelLabel(RegionLevel.PROVINCE)); // "省"



// 方法 2：
const RegionLevel = {
  PROVINCE: { value: "province", label: "省" },
  CITY: { value: "city", label: "市" },
  AREA: { value: "area", label: "区" },
  STREET: { value: "street", label: "街道" }
} as const;

// 类型定义
type RegionLevel = typeof RegionLevel[keyof typeof RegionLevel]["value"];
type RegionLevelObject = typeof RegionLevel[keyof typeof RegionLevel];

// 使用示例
console.log(RegionLevel.PROVINCE.value); // "province"
console.log(RegionLevel.PROVINCE.label); // "省"